package constant

type UserStatus int

const (
	UserNormal     UserStatus = 1
	UserValid      UserStatus = -1
	UserUnVerified UserStatus = 0
)

type Event string

const (
	UserRegisterEvent Event = "user_register"
	UserPrivateEvent  Event = "user_private_message"
)

type AliYunPanRespMessage string

const (
	QRCodeExpired       AliYunPanRespMessage = "QRCodeExpired"
	AppNotExists        AliYunPanRespMessage = "AppNotExists"
	InvalidClientSecret AliYunPanRespMessage = "InvalidClientSecret"
	InvalidCode         AliYunPanRespMessage = "InvalidCode"
	InvalidClientId     AliYunPanRespMessage = "InvalidClientId"
	InvalidGrantType    AliYunPanRespMessage = "InvalidGrantType"
)

func EventToString(event Event) string {
	switch event {
	case UserRegisterEvent:
		return "user_register"
	case UserPrivateEvent:
		return "user_private_message"
	default:
		return ""
	}
}

func AliYunMessageToString(message AliYunPanRespMessage) string {
	switch message {
	case AppNotExists:
		return "应用不存在"
	case QRCodeExpired:
		return "QRCode is expired"
	case InvalidClientId:
		return "应用ID和构造授权链接时填的不一致"
	case InvalidClientSecret:
		return "应用密钥不对"
	case InvalidCode:
		return "授权码为空或过期"
	case InvalidGrantType:
		return "无效的担保类型，目前仅支持 authorization_code 和 refresh_token"
	default:
		return ""
	}
}
